﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace AppFabricAdministrator
{
    public partial class TestCache: UserControl
    {
        public static TestCache Current
        {
            get
            {
                if (currentObj == null)
                    currentObj = new TestCache();
                return currentObj;
            }
        }
        private static TestCache currentObj;

        public NamedCaches NamedCacheControl;
        private TestCache()
        {
            InitializeComponent();
            NamedCacheControl = NamedCaches.GetCurrentNamedCaches(false);
            NamedCacheControl.Dock = DockStyle.Fill;
            this.scRC.Panel1.Controls.Clear();
            this.scRC.Panel1.Controls.Add(NamedCacheControl);
        }

        public void TestAdd()
        {
            TestAdd ta = new TestAdd();
            ta.Dock = DockStyle.Fill;
            scTest.Panel1.Controls.Clear();
            scTest.Panel1.Controls.Add(ta);
        }
        public void TestGet()
        {
            TestGet tg = new TestGet();
            tg.Dock = DockStyle.Fill;
            scTest.Panel1.Controls.Clear();
            scTest.Panel1.Controls.Add(tg);
        }
        public void TestRemove()
        {
            TestRemove tr = new TestRemove();
            tr.Dock = DockStyle.Fill;
            scTest.Panel1.Controls.Clear();
            scTest.Panel1.Controls.Add(tr);
        }
        public void PublishResult(string format,params string[] values)
        {
            string message = string.Format(format, values);
            tbPublishResult.Text = message;
        }
    }
}
